home *** CD-ROM | disk | FTP | other *** search
- // fa3.cpp - a dynamic array of float with operator[]
- // as both const and non-const member functions
-
- #include "fa3.h"
- #include <assert.h>
-
- // other float_array member function definitions ...
-
- const float &float_array::operator[](size_t i) const
- {
- assert(i < len);
- return array[i];
- }
-
- float &float_array::operator[](size_t i)
- {
- assert(i < len);
- return array[i];
- }
-
-